1. Field of the Invention
Methods and apparatuses consistent with the present invention relate to a Java virtual machine, and more particularly, to invoking an inlined method and a Java virtual machine using the inlined method.
2. Description of the Related Art
In order to develop hardware platform-dependent application programs, application programs must be separately designed to be compatible with respective corresponding hardware platform, even though the application programs are to perform the same operations. Accordingly, the demand for the development of hardware platform-independent application programs has gradually increased. As part of efforts to meet this demand, virtual machines that are obtained by abstracting hardware platforms have been developed. An example of such virtual machines are Java virtual machines.
In order to generate a platform-independent execution file using Java, a source code is complied into a bytecode, which is a unique format for Java programs, and enables a Java virtual machine to execute the bytecode.
Conventional Java virtual machines are classified, according to the types of their respective execution engines, into interpreter-type Java virtual machines, just-in-time (JIT) compiler-type Java virtual machines, interpreter-and-JIT compiler-type Java virtual machines, and ahead-of-time (AOT) compiler-type Java virtual machines.
In the case of interpreter-type Java virtual machines, a plurality of bytecodes of a method to be executed are sequentially interpreted by an interpreter, thereby enabling an application program to operate. An interpreter manages information regarding a method currently being executed using a data structure called ‘frame’.
If a method to be invoked is sufficiently long and complicated, then there is the need to preserve a frame that is independent from the method by creating a new frame. However, if the method to be invoked is a very simple method (e.g., a method such as a setter function or a getter function that simply reads/writes necessary values by accessing a field in a class), then the creation of a new frame for the purpose of invoking the method to be invoked may be inefficient and time-consuming.
In the meantime, Korean Patent Laid-Open Gazette No. 10-2005-0074766, entitled “System and Method for Improving Processing Speed of Java Program,” discloses a technique of improving the performance of an application program by enabling a Java virtual machine to perform the loading of a class file and the compilation of the class file at the same time. However, this technique simply aims to improve the processing speed of a Java program using a complier, and thus may not be able to be applied to Java virtual machines using an interpreter.